import request from '@/utils/request'

//推广管理-优惠券列表查询
export function listCoupon(query){
    return request({
        url: '/coupon/list',
        method: 'get',
        params: query
    })
}

//商城管理-新增优惠券
export function createCoupon(data){
    return request({
        url: '/coupon/create',
        method: 'post',
        data
    })
}

//商城管理-修改优惠券
export function updateCoupon(data){
    return request({
        url: '/coupon/update',
        method: 'post',
        data
    })
}

export function deleteCoupon(data){
    return request({
        url: '/coupon/delete',
        method: 'post',
        data
    })
}

export function readCoupon(id){
    return request({
        url: '/coupon/read',
        method: 'get',
        params:{id}
    })
}
//推广管理-用户优惠券列表查询
export function listCouponUser(query){
    return request({
        url: '/coupon/listuser',
        method: 'get',
        params: query
    })
}